﻿<EpiDashboard:GadgetBase x:Class="EpiDashboard.Old_DuplicatesListControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:EpiDashboard="clr-namespace:EpiDashboard"
    xmlns:Controls="clr-namespace:EpiDashboard.Controls"    
    Style="{DynamicResource gadgetBaseStyle}">    
    <EpiDashboard:GadgetBase.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="..\..\ResourceDictionary.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </EpiDashboard:GadgetBase.Resources>
    <Grid>
        <Controls:ShadowRectangle x:Name="rectangleShadow"></Controls:ShadowRectangle>
        
        <Border Name="borderAll" Style="{DynamicResource mainGadgetBorder}" >
            <Border.ContextMenu>
                <ContextMenu x:Name="gadgetContextMenu">
                    <MenuItem x:Name="mnuCopy" Header="Copy data to clipboard"/>
                    <MenuItem x:Name="mnuSendDataToHTML" Header="Send data to web browser">
                        <MenuItem.Icon>
                            <Image Source="../../Images/saveHTML.png" />
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem x:Name="mnuSendDataToExcel" Header="Send data to Excel" />
                    <Separator/>
                    <MenuItem x:Name="mnuSendToBack" Header="Send gadget to back"/>
                    <MenuItem x:Name="mnuClose" Header="Close this gadget"/>
                </ContextMenu>
            </Border.ContextMenu>

            <Grid x:Name="grdMain">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="0" />
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="0" />
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="0" />
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                </Grid.RowDefinitions>

                <Controls:GadgetHeaderPanel x:Name="headerPanel" Grid.Row="0" IsDescriptionButtonAvailable="False" IsFilterButtonAvailable="False" Text="Duplicates List" />
                <Controls:GadgetMessagePanel Margin="4" x:Name="messagePanel" Grid.Row="2" Text="" />
                <Controls:GadgetDescriptionPanel Grid.Row="4" PanelMode="Collapsed" x:Name="descriptionPanel"></Controls:GadgetDescriptionPanel>
                
                <Controls:GadgetInfoPanel Grid.Row="4" Visibility="Collapsed" Margin="4" x:Name="infoPanel"></Controls:GadgetInfoPanel>
                <StackPanel Grid.Row="7" x:Name="panelMain" HorizontalAlignment="Left" VerticalAlignment="Top"></StackPanel>
                <Controls:GadgetWaitPanel x:Name="waitPanel" Visibility="Collapsed" Grid.Row="1" Grid.RowSpan="6" Style="{DynamicResource gadgetWaitPanelStyle}" />
                    <StackPanel Grid.Row="1" Grid.RowSpan="7" Margin="00,-15,-10,0"  HorizontalAlignment="Right" VerticalAlignment="Top" >
                    <Grid x:Name="ConfigGrid" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,15,10,0">
                                <Rectangle Style="{DynamicResource rectangleConfigOuter}" />
                                <Rectangle Style="{DynamicResource rectangleConfigInner}" />

                                <Path x:Name="pathTriangle" 
                                    Margin="0,-2,90,0"
                                    Data="M 5 0 L 10 10 0 10 Z" Fill="{DynamicResource gadgetBackgroundBrush}" IsHitTestVisible="False" HorizontalAlignment="Right" VerticalAlignment="Top" Height="7" />
                        
                        <StackPanel Orientation="Vertical" Margin="25, 10, 25, 25" HorizontalAlignment="Center" VerticalAlignment="Top" >
                            <TextBlock x:Name="ConfigExpandedTitle" HorizontalAlignment="Center" TextAlignment="Center" Text="Deduplication Properties" Margin="5" FontWeight="Bold" />
                            <Grid x:Name="grdDeduplicationOptions" Width="Auto">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="24"/>
                                    <RowDefinition Height="21"/>
                                    <RowDefinition Height="24"/>
                                    <RowDefinition Height="24"/>
                                    <RowDefinition Height="24"/>
                                    <RowDefinition Height="24"/>
                                    <RowDefinition Height="24"/>
                                    <RowDefinition Height="24"/>
                                    <RowDefinition Height="24"/>
                                    <RowDefinition Height="84"/>
                                    <RowDefinition Height="24"/>
                                    <RowDefinition Height="24"/>
                                    <RowDefinition Height="12"/>
                                </Grid.RowDefinitions>

                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="170"/>
                                    <ColumnDefinition Width="170"/>
                                    <ColumnDefinition Width="170"/>
                                </Grid.ColumnDefinitions>
                                <TextBlock x:Name="tblockMainVariable" Grid.Row="0" Grid.RowSpan="1" VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="0,0,0,0" Text="Key fields:" TextAlignment="Center" />
                                <ListBox x:Name="lbxDedupFields" FontFamily="Global User Interface" Grid.Row="1" Grid.RowSpan="10" HorizontalAlignment="Left" Margin="0,0,0,0" SelectedIndex="0" SelectionMode="Extended" Width="160" />
                                <TextBlock x:Name="tblockDisplayVariable" Grid.Row="0" Grid.RowSpan="1" VerticalAlignment="Bottom" HorizontalAlignment="Left" Grid.Column="1" Text="Additional fields to display:" TextAlignment="Center" />
                                <ListBox x:Name="lbxDisplayFields" FontFamily="Global User Interface" Grid.Row="1" Grid.RowSpan="10" Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,0" SelectedIndex="0" SelectionMode="Extended" Width="160"/>

                                <TextBlock x:Name="tblockMaxVarNameLength" Grid.Column="2" Grid.Row="2" VerticalAlignment="Bottom"  HorizontalAlignment="Left" TextAlignment="Center" Text="Max variable name length:" Margin="0,5,0,0"  />
                                <TextBox x:Name="txtMaxColumnLength" Grid.Column="2" Grid.Row="3"  Width="60" HorizontalAlignment="Left" Text="24" Margin="0, 0, 0, 0" PreviewTextInput="txtMaxColumns_PreviewTextInput"></TextBox>

                                <TextBlock x:Name="tblockMaxRows" Grid.Column="2" Grid.Row="4" VerticalAlignment="Bottom" HorizontalAlignment="Left" TextAlignment="Center" Text="Max rows to display:" Margin="0,5,0,0"  />
                                <TextBox x:Name="txtMaxRows" Grid.Column="2" Grid.Row="5" Width="60" HorizontalAlignment="Left" Text="50" Margin="0, 0, 0, 00" PreviewTextInput="txtMaxColumns_PreviewTextInput" TextChanged="txtMaxRows_TextChanged"></TextBox>

                                <TextBlock x:Name="tblockInst1" Grid.Column="0" Grid.Row="11" FontSize="9" TextWrapping="Wrap" VerticalAlignment="Top" HorizontalAlignment="Left" TextAlignment="Left" Text="Ctrl+Left-click on variable names. Ctrl+A will select all variables." Margin="0,0,0,0"  />
                                <TextBlock x:Name="tblockInst2" Grid.Column="1" Grid.Row="11" FontSize="9" TextWrapping="Wrap" VerticalAlignment="Top" HorizontalAlignment="Left" TextAlignment="Left" Text="* Right-click on variables to remove or change sort properties." Margin="0,0,0,0"  />
                                <StackPanel Grid.Row="6" Grid.RowSpan="8" Margin="0,8,0,0" Grid.Column="2">
                                    <Grid x:Name="grdDimensions" Margin="0,0,0,5">
                                        <Grid.RowDefinitions>
                                            <RowDefinition />
                                            <RowDefinition />
                                        </Grid.RowDefinitions>

                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition />
                                            <ColumnDefinition Width="10" />
                                            <ColumnDefinition />
                                        </Grid.ColumnDefinitions>
                                        <TextBlock x:Name="tblockMaxHeight" Grid.Row="0" Grid.Column="2" VerticalAlignment="Bottom" HorizontalAlignment="Left" TextAlignment="Center" Text="Max height:" Margin="0,5,0,0"  />
                                        <TextBox x:Name="txtMaxHeight" Grid.Row="1" Grid.Column="2" Width="60" HorizontalAlignment="Left" Text="500" PreviewKeyDown="txtInput_PositiveIntegerOnly_PreviewKeyDown" Margin="0, 0, 0, 0"></TextBox>

                                        <TextBlock x:Name="tblockMaxWidth" Grid.Row="0" Grid.Column="0" VerticalAlignment="Bottom" HorizontalAlignment="Left" TextAlignment="Center" Text="Max width:" Margin="0,5,0,0"  />
                                        <TextBox x:Name="txtMaxWidth" Grid.Row="1" Grid.Column="0" Width="60" HorizontalAlignment="Left" Text="800" PreviewKeyDown="txtInput_PositiveIntegerOnly_PreviewKeyDown" Margin="0, 0, 0, 0"></TextBox>
                                    </Grid>
                                    <CheckBox x:Name="checkboxTabOrder" Margin="0,2,0,0" Content="Sort variables by tab order" Visibility="Visible" IsEnabled="true" />
                                    <CheckBox x:Name="checkboxUsePrompts" Margin="0,2,0,0" Content="Use field prompts" Visibility="Visible" IsEnabled="true" />
                                    <CheckBox x:Name="checkboxListLabels" Margin="0,2,0,0" Content="Display list labels" IsEnabled="true"/>
                                    <!--<CheckBox x:Name="checkboxAltRowColors" Content="Alternating row colors" Grid.Row="10" Grid.Column="2" Visibility="Collapsed" IsEnabled="true" />-->
                                    <CheckBox x:Name="checkboxLineColumn" Margin="0,2,0,0" Content="Show line column" IsChecked="True" />
                                    <CheckBox x:Name="checkboxColumnHeaders" Margin="0,2,0,0" Content="Show column headings" IsChecked="True" />
                                    <CheckBox x:Name="checkboxShowNulls" Margin="0,2,0,0" Content="Show missing representation" IsChecked="True" />
                                    <CheckBox x:Name="checkboxAllowUpdates" Margin="0,2,0,0" Content="Allow updates" Visibility="Collapsed" IsEnabled="true" />
                                </StackPanel>
                            </Grid>
                            <Button x:Name="btnRun" Content="Generate Deduplication List" Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="2" Click="btnRun_Click" />
                        </StackPanel>
                    </Grid>
                </StackPanel>
            </Grid>
        </Border>
    </Grid>
</EpiDashboard:GadgetBase>
